package com.itic.appbase.framework.utils;

import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.util.HashMap;
import java.util.Map;

public class MyKeyListener  extends KeyAdapter{

	 private Map<String,String> temp=new HashMap<String,String>();
	 
	 public void keyPressed(KeyEvent e){  
		 
         //当按下alt时
         if( e.getKeyCode() == KeyEvent.VK_ALT ){
          //调用方法
        	  //System.out.println("alt"); 
        	  temp.put("alt", "success");
        	  //插入一个临时的地方，记录时间
         }  
         if( e.getKeyCode() == KeyEvent.VK_M ){
             //调用方法
       	      //System.out.println("m");
       	      temp.put("m", "success");
         }
         if( "success".equals(temp.get("alt")) && "success".equals(temp.get("m")) ){
        	 //System.out.println("success");
        	 temp.put("alt","null");
        	 temp.put("m","null");
        	 System.out.println("success");
        	 //载图

         }
     }  
}
